package cn.azzhu.day02.transformations;

import org.apache.flink.api.common.typeinfo.Types;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.util.Collector;

import java.util.Arrays;

/**
 * filter
 * @author azzhu
 * @create 2020-09-18 00:31:58
 */
public class TransformationDemo3 {
    public static void main(String[] args) throws Exception {
        final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        final DataStreamSource<Integer> nums = env.fromElements(1,2,3,4,5,6,7,8,9);

        final SingleOutputStreamOperator<Integer> odd = nums.filter(num -> num % 2 != 0);

        odd.print();

        env.execute("TransformationDemo2");
    }
}
